<template>
	<view>
		<view class="video">
			<video class="video-movie" src="https://media.w3.org/2010/05/sintel/trailer.mp4"
				poster="https://img2.baidu.com/it/u=1776766142,680351088&fm=26&fmt=auto&gp=0.jpg" controls></video>
		</view>
		<view class="video-wapper">
			<navigator :url="'./cover/cover?coverId=' + 123 ">
				<image 
					class="view-img" 
					src="https://img1.baidu.com/it/u=488054824,781673712&fm=26&fmt=auto&gp=0.jpg"
					mode="aspectFill"
				></image>
			</navigator>
			<view class="video-info">
				<view class="video-title">X战警：黑凤凰</view>
				<view class="video-desc">2018/美国/科幻/超级英雄22222233333332</view>
				<view class="video-desc">原名：Aquaman</view>
				<view class="video-desc">影片时长：143分钟（中国大陆）</view>
				<view class="video-desc">上映时间：2018-12-07（中国大陆）</view>
				<view class="score-block">
					<view class="score-big">
						<view class="vide-star">综合评分:</view>
						<view class="score-score">8.7</view>
					</view>

					<view class="score-like">
						<trailerStars score='9.1' showScore='1'></trailerStars>
						<view class="like-like">9631人点赞</view>
					</view>

				</view>
			</view>
		</view>

		<view class="line-wapper">
			<view class="line"></view>
		</view>

		<view class="plots-block">
			<view class="plots-title">剧情介绍</view>
			<view class="plots-desc">
				在X战警：黑凤凰X战警
				：黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰
				黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰
				黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰
				黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰
				黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰
				黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰X战警：黑凤凰
			</view>
		</view>

		<view class="photo-block">
			<view class="photo-title">演员列表</view>
			<scroll-view scroll-x="true" class="photo-list">
				<view class="actor-block" v-for="(img,index) in imgs">
					<image class="actor-actor"  :src="img" mode="aspectFill"></image>
					<view class="actor-title">贝克汉姆</view>
					<view class="actor-role">导演</view>
				</view>
			</scroll-view>
		</view>

		<view class="photo-block">
			<view class="photo-title">剧照</view>
			<scroll-view scroll-x="true" class="photo-list">
				<image @click="previewPhoto" :data-imgid="index" v-for="(img,index) in imgs" class="photo-photo" :src="img" mode="aspectFill"></image>
			</scroll-view>

		</view>

	</view>
</template>

<script>
	import trailerStars from '../../components/trailerStars.vue'
	export default {
		components: {
			trailerStars
		},
		data() {
			return {
				info: {
					title: ""
				},
				imgs: ['https://img1.baidu.com/it/u=488054824,781673712&fm=26&fmt=auto&gp=0.jpg',
					'https://img2.baidu.com/it/u=1804272601,468942649&fm=26&fmt=auto&gp=0.jpg',
					'https://img0.baidu.com/it/u=3753972264,2197167502&fm=26&fmt=auto&gp=0.jpg',
					'https://img0.baidu.com/it/u=3033541366,2843962344&fm=26&fmt=auto&gp=0.jpg',
					'https://img2.baidu.com/it/u=1943521773,1045531091&fm=26&fmt=auto&gp=0.jpg',
				]
			}   
		},
		onLoad(par) {
			console.log(par);
			
			// 通过API修改导航栏的属性
			// uni.setNavigationBarColor({
			// 	frontColor: "#ffffff",
			// 	backgroundColor: "#000000"
			// })
		},
		onShareAppMessage(res) {
			console.log(res)
			return {
				title:'分享内容...',
				path:'/pages/movie/movie?from=share&id=1'
			}
		},
		onNavigationBarButtonTap(par){
			console.log(par)
			if(par.type=='share'){
				console.log("点击了分享")
				
				uni.share({
				    provider: "weixin",
				    scene: "WXSenceTimeline",
				    type: 0,
				    href: "http://uniapp.dcloud.io/",
				    title: "uni-app分享",
				    summary: "我正在使用HBuilderX开发uni-app，赶紧跟我一起来体验！",
				    imageUrl: "https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/d8590190-4f28-11eb-b680-7980c8a877b8.png",
				    success: function (res) {
				        console.log("success:" + JSON.stringify(res));
				    },
				    fail: function (err) {
				        console.log("fail:" + JSON.stringify(err));
				    }
				});
				
			}
			
			if(par.type=='home'){
				uni.switchTab({
					url:"../index/index"
				})
			}
			
		},
		methods: {
			previewPhoto(e){
				var id = e.currentTarget.dataset.imgid;
				
				console.log(e)
				uni.previewImage({
					urls:this.imgs,
					current:this.imgs[id]
				})
			},
			showImg(e){
				uni.navigateTo({
					url:"./cover/cover"
				})
			}
		}
	}
</script>

<style>
	@import url("movie.css");
</style>
